#ifndef BUILDPACKET_H
#define BUILDPACKET_H

#include <netinet/ip.h>
#include <netinet/tcp.h>

// #define LEN 0 
#define BUFFER_SIZE 1024

//数据包结构体，数据部分为空
struct dataPacket{
	struct iphdr ip;
	struct tcphdr tcp;
	// unsigned char data[LEN];
	char* data;
	int size;
};


char* getLocalIP();

dataPacket* buildDataPacket();

void setIPHeader(struct iphdr *ipHeader);

void setTCPHeader(struct tcphdr *tcpHeader);

void setData(dataPacket *packet,int len,char* data);

dataPacket* buildDataPacket(int port,char *ip);

#endif